home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7007 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: keats.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: calloc help needed
  5. Date: 16 Feb 1996 20:27:49 -0800
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4g3lg5INNs1c@keats.ugrad.cs.ubc.ca>
  8. References: <1996Feb15.125431.7751@leeds.ac.uk> <4fvmgbINNbp0@keats.ugrad.cs.ubc.ca> <danpop.824470182@rscernix>
  9. NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
  10.  
  11. In article <danpop.824470182@rscernix>, Dan Pop <danpop@mail.cern.ch> wrote:
  12.  >In <4fvmgbINNbp0@keats.ugrad.cs.ubc.ca> c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku) writes:
  13.  >
  14.  >>In article <1996Feb15.125431.7751@leeds.ac.uk>,
  15.  >>A M Casey <csyamc@scs.leeds.ac.uk> wrote:
  16.  >>
  17.  >> >doesnt work, as far as I can tell calloc returns an int.
  18.  >>
  19.  >>It is probably "implicitly defined" to return an int, because you lack a
  20.  >>declaration. Try including the "malloc.h" header file.
  21.  >
  22.  >You misspelled <stdlib.h>.  There is no such thing as "malloc.h" defined
  23.  >by the C standard.  There is an /usr/include/malloc.h on my system,
  24.  >but it doesn't contain any declaration for calloc (the only functions
  25.  >declared there are mallinfo and mallopt). 
  26.  
  27. Ah, right. No such thing as a standard malloc.h indeed. I think that I'm
  28. suffering from having used too many brain-damaged systems. I should have
  29. checked that one instead of being lazy.  The system I'm on right now has the
  30. declarations in both places. Argh.  I know that I came up with the idea
  31. including "malloc.h" in some situation where it had to be done and somehow it
  32. stuck in my memory.
  33.  
  34. My apologies. Even K&R doesn't mention <malloc.h> as a standard header.
  35. -- 
  36.  
  37.